package com.xbongbong.saas.script.tempenum;

import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import com.xbongbong.saas.enums.business.BadDebtEnum;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author feng.zheng
 * @version v1.0
 * @date 2019/3/14 16:26
 * @since v1.0
 */
@Getter
public enum TempBadDebtEnum {
    //刷脚本专用枚举
    PAYMENT_SHEET_NO(BadDebtEnum.PAYMENT_SHEET_NO),
    BAD_DEBT_AMOUNT(BadDebtEnum.BAD_DEBT_AMOUNT),
    BAD_TIME(BadDebtEnum.BAD_TIME),
    BELONG_ID(BadDebtEnum.BELONG_ID),
    MEMO(BadDebtEnum.MEMO),
    PAYMENT(BadDebtEnum.PAYMENT);

    private BadDebtEnum anEnum;

    TempBadDebtEnum(BadDebtEnum anEnum) {
        this.anEnum = anEnum;
    }

    public static List<TempBadDebtEnum> getAllEnum() {
        List<TempBadDebtEnum> list = new ArrayList<>();
        Collections.addAll(list, values());
        return list;
    }

    public static void initPayment(FieldAttrEntity fieldAttrEntity) {
        fieldAttrEntity.setLinkedType(XbbRefTypeEnum.PAYMENT.getCode());
    }
}
